<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
		<title><?php echo ($menu_title); ?>-<?php echo (C("SITE_NAME")); ?></title>

		<meta name="description" content="overview &amp; stats" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />

    <meta http-equiv="X-UA-Compatible" content="IE=9;IE=8;IE=7;" />
    <meta http-equiv="X-UA-Compatible" content="edge" />
    <link rel="icon" href="/favicon.ico" type="image/x-icon" />
<!-- 框架样式 -->

<link href="/Statics/Admin/css/bootstrap.min.css" rel="stylesheet" />

<link href="/Statics/Admin/css/buttons.css" rel="stylesheet" />
<link rel="stylesheet" href="/Statics/Admin/css/font-awesome.min.css" />
    <link rel="stylesheet" href="/Statics/Admin/js/chosen/chosen.css" />
<!--[if IE 7]>
		  <link rel="stylesheet" href="/Statics/Admin/css/font-awesome-ie7.min.css" />
		<![endif]-->

<!-- 独立样式 -->


<!-- 基础css -->

<link rel="stylesheet" href="/Statics/Admin/css/ace.min.css" />
<link rel="stylesheet" href="/Statics/Admin/css/plus.css" />

<!--<link rel="stylesheet" href="/Statics/Admin/css/ace-rtl.min.css" />
<link rel="stylesheet" href="/Statics/Admin/css/ace-skins.min.css" />-->

<script type="text/javascript">
        //全局变量
var GV = {
    DIMAUB: "/",
	JS_ROOT: "/Statics/Admin/js/"
};
</script>

<!-- 基础脚本 -->



<script src="/Statics/Admin/js/jquery.js"></script>

<script src="/Statics/Admin/js/ace-extra.min.js"></script>
<script src="/Statics/Admin/js/ace-elements.min.js"></script> 

<script src="/Statics/Admin/js/ace.min.js"></script>
<script src="/Statics/Admin/js/bootstrap.min.js"></script>
<script src="/Statics/Admin/js/sco/js/sco.modal.js"></script> 
<script src="/Statics/Admin/js/sco/js/sco.message.js"></script> 
<script src="/Statics/Admin/js/common.js"></script> 
<script src="/Statics/Admin/js/wind.js"></script>

    <script src="/Statics/Admin/js/chosen/chosen.jquery.min.js"></script>
<!-- 脚本插件 --> 

    <script src="/Statics/Admin/js/content.js"></script>
    <script src="/Statics/Admin/js/ueditor/ueditor.config.js"></script>
    <script src="/Statics/Admin/js/ueditor/ueditor.all.min.js"></script>

    <script>

       $(function(){


           var num=0;

           $("#product_cat_add").click( function(){


               var color=$("#color").val();



               var chicun=$("#chicun").val();
               var chicun_name=$("#chicun").find("option:selected").text();
               var waikuang=$("#waikuang").val();
               var waikuang_name=$("#waikuang").find("option:selected").text();
               var price=$("#price").val();
               var kucun=$("#kucun").val();

               if( color == ''){

                   $("#color").focus();
                   return false;

               }
               if(chicun == ''){

                   $("#chicun").focus();
                   return false;

               }

               if(waikuang == ''){

                   $("#waikuang").focus();
                   return false;

               }

               if(price<=0){

                   $("#price").focus();
                   return false;

               }


               if(kucun<=0){

                   $("#kucun").focus();

                   return false;

               }







               num++;

               html=  $("#cs_list tbody").html();
               html+="<tr id='tr_"+num+"'>" +
                       "<td>"+color+"</td>" +
                       "<td>"+chicun_name+"</td>" +
                       "<td>"+waikuang_name+"</td>" +
                       "<td>￥"+price+"</td>" +
                       "<td>"+kucun+"" +
                       "<input type='hidden' name='cs_list["+num+"][color]' value='"+color+"'>" +
                       "<input type='hidden' name='cs_list["+num+"][chicun]' value='"+chicun+"'>" +
                       "<input type='hidden' name='cs_list["+num+"][waikuang]' value='"+waikuang+"'>" +
                       "<input type='hidden' name='cs_list["+num+"][price]' value='"+price+"'>" +
                       "<input type='hidden' name='cs_list["+num+"][kucun]' value='"+kucun+"'>" +
                       "</td>" +
                       "<td><button class='btn btn-info btn-xs list_remove' ><i class='icon-remove'></i></button></td>" +
                       "</tr>";

               $("#cs_list tbody").html(html);














               return false;
           })

           $(document).on("click",".list_remove",function(){

               $(this).parent().parent().remove(); return false;

           })





       })

    </script>



<!-- 框架脚本 --> 

<link rel="stylesheet" href="/Statics/Admin/js/sco/css/sco.message.css" />
<!--[if lte IE 8]>
		  <link rel="stylesheet" href="/Statics/Admin/css/ace-ie.min.css" />
		<![endif]-->



<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->

<!--[if lt IE 9]>
		<script src="/Statics/Admin/js/html5shiv.js"></script>
		<script src="/Statics/Admin/js/respond.min.js"></script>
		<![endif]-->


</head>
<body>
<!--<body class="navbar-fixed breadcrumbs-fixed">--> 

<!--<div class="navbar navbar-default navbar-fixed-top" id="navbar">-->
<div class="navbar navbar-default" id="navbar">
  <div class="navbar-container" id="navbar-container">
    <div class="navbar-header pull-left"> <a href="#" class="navbar-brand"> <small>  <?php echo (C("SITE_NAME")); ?> </small> </a> </div>


    <div class="navbar-header pull-right" role="navigation">



					<ul class="nav ace-nav">
						

						<li class="green" id="new_message" style="display:none">
							<a  href="<?php echo U('/Admin/Message/index');?>">
								<i class="icon-envelope icon-animated-vertical"></i>
								您有新消息
							</a>

							
						</li>

						<li class="light-blue"> <a data-toggle="dropdown" href="#" class="dropdown-toggle"> <img class="nav-user-photo" src="/Statics/Admin/img/user.jpg" alt="<?php echo ($admin["name"]); ?>"> <span class="user-info"> <small>欢迎,</small><?php echo ((isset($admin["nicename"]) && ($admin["nicename"] !== ""))?($admin["nicename"]):$admin[name]); ?> </span> <i class="icon-caret-down"></i> </a>
          <ul class="user-menu pull-right dropdown-menu dropdown-yellow dropdown-caret dropdown-closer">
            <li><a href="<?php echo u('Admin/Admin/password');?>"><i class="icon-cog"></i> 修改密码</a></li>
            <!--<li><a href="<?php echo u('Admin/Admin/userinfo');?>"><i class="icon-user"></i> 个人资料</a></li>-->
            <li class="divider"></li>
            <li><a href="<?php echo U('Public/logout');?>"><i class="icon-sign-out"></i> 退出</a></li>
          </ul>
        </li>

					
					</ul><!-- /.ace-nav -->
				</div>
 </div>
</div>
<div class="main-container" id="main-container">
  <div class="main-container-inner"> <a class="menu-toggler" id="menu-toggler" href="#"> <span class="menu-text"></span> </a>
    <div class="sidebar" id="sidebar"> 
      <!--<div class="sidebar sidebar-fixed" id="sidebar">-->
      
        <div class="sidebar-shortcuts" id="sidebar-shortcuts">
          <div class="sidebar-shortcuts-large" id="sidebar-shortcuts-large">
            <a class="btn btn-success" target="_blank" href="/" title="前台首页" > <i class="icon-home"></i> </a>
            <a class="btn btn-info" href="<?php echo U('Admin/Product/index');?>"> <i class="icon-search"></i> </a>
            <a class="btn btn-warning" href="" target="_blank"> <i class="icon-book"></i> </a>
            <a class="btn btn-danger ajax-get " title="清除缓存" href="<?php echo u('Admin/Index/clearcache');?>"> <i class="icon-trash"></i> </a>
          </div>
          <div class="dedebar-shortcuts-mini" id="sidebar-shortcuts-mini"> <span class="btn btn-success"></span> <span class="btn btn-info"></span> <span class="btn btn-warning"></span> <span class="btn btn-danger"></span> </div>
        </div>
        <ul class="nav nav-list">
        <?php if(is_array($submenus)): $i = 0; $__LIST__ = $submenus;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$v): $mod = ($i % 2 );++$i;?><li <?php if(in_array(($v[id]), is_array($f_lanmu)?$f_lanmu:explode(',',$f_lanmu))): ?>class="active"<?php endif; ?>>
          <?php if(!count($v['child'])): ?><a href="<?php echo U($v[name]);?>"> <i class=" icon-<?php echo ((isset($v["icon"]) && ($v["icon"] !== ""))?($v["icon"]):'desktop'); ?>"></i> <span class="menu-text"><?php echo ($v["title"]); ?></span> </a>
            <?php else: ?>
            <a href="#" class="dropdown-toggle"> <i class=" icon-<?php echo ((isset($v["icon"]) && ($v["icon"] !== ""))?($v["icon"]):'desktop'); ?>"></i> <span class="menu-text"><?php echo ($v["title"]); ?></span> <b class="arrow icon-angle-right"></b> </a>
            <ul  class="submenu">
              <!--二级菜单-->
              <?php if(is_array($v['child'])): $i = 0; $__LIST__ = $v['child'];if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><li <?php if(in_array(($vo[id]), is_array($f_lanmu)?$f_lanmu:explode(',',$f_lanmu))): ?>class="active"<?php endif; ?>>
                <?php if(!count($vo['child'])): ?><a href="<?php echo U($vo[name]);?>"><i class=" icon-<?php echo ((isset($vo["icon"]) && ($vo["icon"] !== ""))?($vo["icon"]):'caret-right'); ?>"></i> <span class="menu-text"><?php echo ($vo["title"]); ?></span> </a>
                  <?php else: ?>
                  <a href="#" class="dropdown-toggle"><i class=" icon-<?php echo ((isset($vo["icon"]) && ($vo["icon"] !== ""))?($vo["icon"]):'caret-right'); ?>"></i> <span class="menu-text"><?php echo ($vo["title"]); ?></span> <b class="arrow icon-angle-right"></b> </a>
                  <ul  class="submenu">
                
                    <!--三级菜单-->
                    <?php if(is_array($vo['child'])): $i = 0; $__LIST__ = $vo['child'];if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$voo): $mod = ($i % 2 );++$i;?><li <?php if(in_array(($voo[id]), is_array($f_lanmu)?$f_lanmu:explode(',',$f_lanmu))): ?>class="active"<?php endif; ?>> <a href="<?php echo U($voo[name]);?>"> &nbsp;<i class=" icon-<?php echo ((isset($voo["icon"]) && ($voo["icon"] !== ""))?($voo["icon"]):'caret-right'); ?>"></i> <span class="menu-text"><?php echo ($voo["title"]); ?></span> </a> </li><?php endforeach; endif; else: echo "" ;endif; ?>
                  </ul><?php endif; ?>
              </li><?php endforeach; endif; else: echo "" ;endif; ?>
            </ul><?php endif; ?>
        </li><?php endforeach; endif; else: echo "" ;endif; ?>
      </ul>

      <div class="sidebar-collapse" id="sidebar-collapse">
						<i class="icon-angle-double-left" data-fa fa1="icon-angle-double-left" data-fa fa2="icon-angle-double-right"></i>
					</div>




      
    </div>
    <div class="main-content">
      <div class="breadcrumbs" id="breadcrumbs"> 
        <!--<div class="breadcrumbs breadcrumbs-fixed" id="breadcrumbs">--> 
       
        <ul class="breadcrumb">
          <li> <i class="icon-home home-fa fa"></i> <a href="/">主页</a> </li>
         
          <li class="active"><?php echo ($menu_title); ?></li>
        </ul>
        
      
      </div>
      <div class="page-content">
      
        <!--<block  name="body-header">
          <div class="page-header">
            <h2> <?php echo ($meta_title); ?> </h2>
          </div>
        </block>-->
     
        <div class="row">
          <div class="col-xs-12">
           <div class="tabbable">
           
            
    <ul class="nav nav-tabs" >
        <li class="active"><a href=""   >基本设置</a></li>

        <li ><a href="<?php echo U('ProductList/index',array('product_id'=>I('get.id')));?>"   >价格设置</a></li>
    </ul>

            




    <form name="myform" id="myform" action="" method="post" class="form-horizontal J_ajaxForm">

        <div class="tab-content ">


            <div class="form-group">
                <label class="col-sm-2 control-label "> <span class="red">*</span>标题 </label>
                <div class="col-sm-10">
                    <input type="text"  name="title" value="<?php echo ($data["title"]); ?>" class="col-xs-8 col-sm-5 " />
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-2 control-label "> 属性 </label>
                <div class="col-sm-10">
                    <label><input type="checkbox" name="top" value="1"

                        <?php if($data[top]): ?>checked="checked"<?php endif; ?>
                        >  置顶</label>
                    <label><input type="checkbox" name="tui" value="1"  <?php if($data[tui]): ?>checked="checked"<?php endif; ?>> 精品推荐</label>
                    <label><input type="checkbox" name="new" value="1"  <?php if($data['new']): ?>checked="checked"<?php endif; ?>>  新品上架</label>
                </div>
            </div>

            <div class="form-group ">

                <label class="col-sm-2 control-label "> <span class="red">*</span>等级 </label>
                <div class="col-sm-4">
                    <input type="text"  name="dengji" value="<?php echo ($data["dengji"]); ?>" class="col-xs-8 col-sm-5 " />
                </div>
            </div>



            <div class="form-group">
                <label class="col-sm-2 control-label "> <span class="red">*</span>封面 </label>
                <div class="col-sm-10">
                    <div class="clearfix mb10" <?php  if($data[thumb]) { echo "style=\"display: none\" ";} ?>  id="thumb-div"><a class="btn btn-info btn-xs pull-left add-link" data-field="thumb" data-action="img"  >添加外链</a>  <div id="thumb" class="pull-left ml10"></div>
                </div>
                <div id="upload-box-thumb">  <?php  if($data[thumb]) { ?><p><input type="text" class="input " style="width: 500px"  name="thumb" value="<?php echo $data[thumb] ?>" > <a class="fancybox" href="<?php echo $data[thumb] ?>" rel="thumb ">查看</a> <a data-href="/Admin/File/del_file.html" data-url="<?php echo $data[thumb] ?>" data-field="thumb" class="del_att cust">删除</a></p><?php } ?> </div>  <script type="text/javascript">
$(function(){
    	 				Wind.css("uploadify");
    Wind.use("uploadify", function () {
    		
	var up = $("#thumb").Huploadify({
		fileTypeExts	  :"*.jpg;*.gif;*.png;*.jpeg",
		auto:true,
		fileObjName    : "download",multi:false,fileSizeLimit:"5242880",
		showUploadedPercent:true,
		showUploadedSize:true,
		removeTimeout:1,
		uploader:"/Admin/File/upload/field/thumb/model/product/action/img.html",
		uploadLimit:1,
		
		onUploadSuccess:upload_file,
		
	});

	})
});
</script> 
                </div>
            </div>


            <div class="form-group">
                <label class="col-sm-2 control-label "> <span class="red">*</span>编号 </label>
                <div class="col-sm-4">
                    <input type="text"  name="p_id" value="<?php echo ($data["p_id"]); ?>" class="input-large " />
                </div>

                <label class="col-sm-2 control-label "> 尺寸 </label>
                <div class="col-sm-4">
                    <select class="input-large plus"  name="chicun_cate" title="请选择">

                        <option value="">请选择</option>


                        <?php $_result=F('Var_chicun_cate');if(is_array($_result)): $i = 0; $__LIST__ = $_result;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i; $clecked=($vo[id]==$data['chicun_cate'])?'selected':''; ?>


                            <option value="<?php echo ($vo["id"]); ?>" <?php echo ($clecked); ?>><?php echo ($vo["name"]); ?></option><?php endforeach; endif; else: echo "" ;endif; ?>
                    </select>

                </div>
            </div>
                <div class="form-group">

                <label class="col-sm-2 control-label ">工艺 </label>
                <div class="col-sm-4">
                    <select class="input-large plus"  name="gongyi" title="请选择">

                        <option value="">请选择</option>


                        <?php $_result=F('Var_gongyi');if(is_array($_result)): $i = 0; $__LIST__ = $_result;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i; $clecked=($vo[id]==$data['gongyi'])?'selected':''; ?>


                            <option value="<?php echo ($vo["id"]); ?>" <?php echo ($clecked); ?>><?php echo ($vo["name"]); ?></option><?php endforeach; endif; else: echo "" ;endif; ?>
                    </select>

                </div>


                    <label class="col-sm-2 control-label ">类型 </label>
                    <div class="col-sm-4">
                        <select class="input-large plus"  name="fengge" title="请选择">

                            <option value="">请选择</option>


                            <?php $_result=F('Var_fengge');if(is_array($_result)): $i = 0; $__LIST__ = $_result;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i; $clecked=($vo[id]==$data['fengge'])?'selected':''; ?>


                                <option value="<?php echo ($vo["id"]); ?>" <?php echo ($clecked); ?>><?php echo ($vo["name"]); ?></option><?php endforeach; endif; else: echo "" ;endif; ?>
                        </select>

                    </div>



            </div>


            <div class="form-group">


                <label class="col-sm-2 control-label ">品牌 </label>
                <div class="col-sm-4">
                    <select class="input-large plus"  name="brand" title="请选择">

                        <option value="">请选择</option>


                        <?php $_result=F('Var_brand');if(is_array($_result)): $i = 0; $__LIST__ = $_result;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i; $clecked=($vo[id]==$data['brand'])?'selected':''; ?>


                            <option value="<?php echo ($vo["id"]); ?>" <?php echo ($clecked); ?>><?php echo ($vo["name"]); ?></option><?php endforeach; endif; else: echo "" ;endif; ?>
                    </select>

                </div>

                <label class="col-sm-2 control-label "> 作者 </label>
                <div class="col-sm-4">
                    <input type="text"  name="author" value="<?php echo ($data["author"]); ?>" class="col-xs-8 col-sm-5 " />
                </div>




            </div>

            <div class="form-group ">

                <label class="col-sm-2 control-label "> <span class="red">*</span>库存 </label>
                <div class="col-sm-4">
                    <input type="text"  name="kucun" value="<?php echo ($data["kucun"]); ?>" class="input-mini" />
                </div>

            </div>





            <div class="form-group">
                <label class="col-sm-2 control-label "> 关键词 </label>
                <div class="col-sm-10">
                    <input type='text' name='keyword'  value='<?php echo ($data["keyword"]); ?>' style='width:400px'   class='input' placeholder='请输入关键字'>
                    <span class="info">    多关键词之间用空格隔开</span>
                </div>
            </div>


            <div class="form-group">
                <label class="col-sm-2 control-label "> <span class="red">*</span>摘要 </label>
                <div class="col-sm-10">
                    <textarea name='desc'  style="width:600px"><?php echo ($data["desc"]); ?></textarea>
                </div>
            </div>


            <div class="form-group">
                <label class="col-sm-2 control-label "> <span class="red">*</span>详情 </label>
                <div class="col-sm-10">
                      <script id="content" name="content" type="text/plain"><?php echo ($data["content"]); ?></script><script>	 
         UE.getEditor("content",{
         		toolbars:[[
            'fullscreen', 'source', '|', 'undo', 'redo', '|',
            'bold', 'italic', 'underline', 'fontborder', 'strikethrough', 'superscript', 'subscript', 'removeformat', 'formatmatch', 'autotypeset', 'blockquote', 'pasteplain', '|', 'forecolor', 'backcolor', 'insertorderedlist', 'insertunorderedlist', 'selectall', 'cleardoc', '|',
            'rowspacingtop', 'rowspacingbottom', 'lineheight', '|',
            'customstyle', 'paragraph', 'fontfamily', 'fontsize', '|',
            'directionalityltr', 'directionalityrtl', 'indent', '|',
            'justifyleft', 'justifycenter', 'justifyright', 'justifyjustify', '|', 'touppercase', 'tolowercase', '|',
            'link', 'unlink', 'anchor', '|', 'imagenone', 'imageleft', 'imageright', 'imagecenter', '|',
            'simpleupload', 'insertimage', 'emotion', 'scrawl', 'insertvideo', 'music', 'attachment', 'map', 'gmap', 'insertframe', 'insertcode', 'webapp', 'pagebreak', 'template', 'background', '|',
            'horizontal', 'date', 'time', 'spechars', 'snapscreen', 'wordimage', '|',
            'inserttable', 'deletetable', 'insertparagraphbeforetable', 'insertrow', 'deleterow', 'insertcol', 'deletecol', 'mergecells', 'mergeright', 'mergedown', 'splittocells', 'splittorows', 'splittocols', 'charts', '|',
            'print', 'preview', 'searchreplace', 'help', 'drafts'
        ]],
         		
            serverUrl :"/Admin/File/run.html",
            		 initialFrameHeight:400,
			 initialFrameWidth :750,
        });	
            		
            	
                                  		
                                  		
    </script>	
                </div>
            </div>






        </div>






        <?php if($edit): ?><input type="hidden"  name="id"   value="<?php echo ($data["id"]); ?>"  /><?php endif; ?>



        <div class="form-actions">
            <button class="btn btn-info ajax-post"   target-form="J_ajaxForm" type="submit">  <?php if($edit): ?>更新<?php else: ?>提交<?php endif; ?></button>

            <button class="btn btn-return" onclick="javascript:history.back(-1);return false;">返 回</button>
        </div>




    </form>

            </div>
          </div>
          <!-- /.col --> 
        </div>
      </div>
    </div>
    <!--<div class="ace-settings-container" id="ace-settings-container">
					<div class="btn btn-app btn-xs btn-warning ace-settings-btn" id="ace-settings-btn">
						<i class="icon-cog bigger-150"></i>
					</div>

					<div class="ace-settings-box" id="ace-settings-box">
						<div>
							<div class="pull-left">
								<select id="skin-colorpicker" class="hide">
									<option data-skin="default" value="#438EB9">#438EB9</option>
									<option data-skin="skin-1" value="#222A2D">#222A2D</option>
									<option data-skin="skin-2" value="#C6487E">#C6487E</option>
									<option data-skin="skin-3" value="#D0D0D0">#D0D0D0</option>
								</select>
							</div>
							<span>&nbsp; Choose Skin</span>
						</div>

						<div>
							<input type="checkbox" class="ace ace-checkbox-2" id="ace-settings-navbar" />
							<label class="lbl" for="ace-settings-navbar"> Fixed Navbar</label>
						</div>

						<div>
							<input type="checkbox" class="ace ace-checkbox-2" id="ace-settings-sidebar" />
							<label class="lbl" for="ace-settings-sidebar"> Fixed Sidebar</label>
						</div>

						<div>
							<input type="checkbox" class="ace ace-checkbox-2" id="ace-settings-breadcrumbs" />
							<label class="lbl" for="ace-settings-breadcrumbs"> Fixed Breadcrumbs</label>
						</div>

						<div>
							<input type="checkbox" class="ace ace-checkbox-2" id="ace-settings-rtl" />
							<label class="lbl" for="ace-settings-rtl"> Right To Left (rtl)</label>
						</div>

						<div>
							<input type="checkbox" class="ace ace-checkbox-2" id="ace-settings-add-container" />
							<label class="lbl" for="ace-settings-add-container">
								Inside
								<b>.container</b>
							</label>
						</div>
					</div>
				</div>-->
    <!-- /#ace-settings-container --> 
  </div>
  <!-- /.main-container-inner --> 
  
  <a href="#" id="btn-scroll-up" class="btn-scroll-up btn btn-sm btn-inverse"> <i class="icon-angle-double-up  fa-only bigger-110"></i> </a> </div>





<!-- inline scripts related to this page -->


</body>
</html>